package com.szrt.java.day20161229.demo07;

import org.junit.Test;

public class TankTest {
	
	
	@Test
	public void tankTest(){
		
		Tank china99 = new Tank();
		
		String tankType="中国99坦克";
		
		china99.setType(tankType);
		
		//System.out.println(china99.getType());
		
		int distance=30011;
		boolean jg = china99.shoot(tankType, distance);
		
		if(true ==jg){
			System.out.println(tankType+"打中了"+distance+"米的距离");
		}else{
			System.out.println(tankType+"不好意思...没有打中了"+distance+"米的距离");
		}
		
		Tank usaTank = new Tank();
		tankType="美国MP坦克";
		
		usaTank.setType(tankType);
		
		boolean jg02 = usaTank.shoot(tankType, distance);
		
		if(jg02){
			System.out.println(tankType+"打中了"+distance+"米的距离");
		}else{
			System.out.println(tankType+"不好意思...没有打中了"+distance+"米的距离");
		}
		
		
		
		
		
	}
	
	@Test
	public void tankTestBK(){
		
		Tank china99 = new Tank();
		
		china99.setType("中国99坦克");
		
		//System.out.println(china99.getType());
		
		int distance=20000;
		boolean jg = china99.shoot("中国99坦克", distance);
		
		if(true ==jg){
			System.out.println("中国 打中了"+distance+"米的距离");
		}else{
			System.out.println("中国不好意思...没有打中了"+distance+"米的距离");
		}
		
		Tank usaTank = new Tank();
		usaTank.setType("美国MP坦克");
		
		boolean jg02 = usaTank.shoot("美国MP坦克", distance);
		
		if(jg02){
			System.out.println("美国 打中了"+distance+"米的距离");
		}else{
			System.out.println("美国不好意思...没有打中了"+distance+"米的距离");
		}
		
		
		
		
		
	}


	

}
